#ifndef PROPERTY_EDITOR_H
#define PROPERTY_EDITOR_H

#include <ipropertyobject.h>

#include <QtCore/QHash>
#include <QtGui/QStandardItemModel>
#include <QtGui/QTableView>

namespace gui
{
class ComboBoxDelegate;
class CompleterDelegate;
class LineEditDelegate;

class PropertyEditor : public QTableView
{
    Q_OBJECT

public:
    PropertyEditor(QWidget* parent = 0);
    ~PropertyEditor();

private:
    void updateModel();

public slots:
    void propertyObjectChanged(core::IPropertyObject* object);

private slots:
    void changeValue(QStandardItem* changed);

private:
    friend class ComboBoxDelegate;
    friend class CompleterDelegate;

    core::IPropertyObject* m_object;

    QStandardItemModel* m_model;
    QStringList m_headerLabels;

    ComboBoxDelegate* m_listDelegate;
    CompleterDelegate* m_completerDelegate;
    LineEditDelegate* m_stringDelegate;
    LineEditDelegate* m_intDelegate;
};

} // namespace gui

#endif
